package net.thellium.ddiameter.protocol.avp.parser;

public class ParserUtils {
	static int unsignedByteValue(byte val) {
		return (0xFF & val);
	}
	
	static long bytesToLong(byte[] bytes) {
			
			long ret = 0;
			for (int i = 0; i<bytes.length; i++) {
				ret += ParserUtils.unsignedByteValue(bytes[i]) << (8*(bytes.length-1-i));
			}
		
			return ret;
	}
}
